#ifndef SOLUTION_H_
#define SOLUTION_H_
#include <vector>

using namespace std;

class Solution 
{
public:
    vector<int> plusOne(vector<int> &digits) 
	{
        // Start typing your C/C++ solution below
        // DO NOT write int main() function
		int carry = 1;
		vector<int> result;
		
		if(digits.empty())
			return result;

		result.resize(digits.size());

		for(size_t i=digits.size()-1;i != -1;i--)
		{
			int cs = digits[i]+carry;
			result[i]=cs%10;
			carry = cs/10;
		}

		if(carry)
			result.insert(result.begin(),carry);

		return result;        
    }
};

#endif